<?php

namespace app\admin\model\vppz;

use think\Model;
use think\Db;
use traits\model\SoftDelete;

class HealthPackage extends Model
{

    use SoftDelete;



    // 表名
    protected $name = 'vppz_health_package';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';
    // 追加属性
    protected $append = [
		'image_url'	// 需在此处追加属性，才会触发获取器 getPicImageUrlAttr
    ];

     public function community()
    {
        return $this->belongsTo('Community', 'community_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
    	public function getImageUrlAttr($value,$data)
    {
        return \addons\vppz\library\Vpower::dourl($data['image']);
    }
}
